import { _decorator, AudioClip, Component, director } from 'cc'
import { GAME_SCENE_ENUM } from '../Enum'
import { AudioMgr } from '../AudioMgr'
const { ccclass, property } = _decorator

@ccclass('MenuSceneManager')
export class MenuSceneManager extends Component {
  // 菜单页背景音
  @property({ type: AudioClip })
  menuBgm: AudioClip = null

  protected onLoad(): void {
    AudioMgr.inst.play(this.menuBgm, 0.5)
  }
  start() {
    director.preloadScene(GAME_SCENE_ENUM.GAME)
  }
}
